const http = uni.$u.http

//商品
export const goodsList = (params = {}) => http.get('/mall/product/list', {params}); 
export const goodsInfo = (params = {}) => http.get('/mall/product/detail', {params}); 
export const classify = (params = {}) => http.get('/api/goods/classify', params);
export const shareImage = (params = {}) => http.get('/api/goods/share/image', params);

//收藏
export const goodsCollection = (params = {}) => http.post('/mall/user/collection/save', params);
export const collectionList = (params = {}) => http.get('/mall/user/collection', params);

//订单
export const createOrder = (params = {}) => http.post('/mall/order/now/by', params);
export const updateOrder = (params = {}) => http.post('/mall/order/edit', params);
export const orderSubmit = (params = {}) => http.post('/mall/order/submit', params);
export const payment = (params = {}) => http.post('/mall/order/payment', params);
export const orderList = (params = {}) => http.get('/mall/order/self', {params});
export const orderDetail = (params = {}) => http.get('/mall/order/self/detail', {params});
export const cancelOrder = (params = {}) => http.post('/mall/order/cancel', params);
export const createOrderByCarts = (params = {}) => http.post('/mall/order/carts/create', params);

//购物车
export const createCarts = (params = {}) => http.post('/mall/carts/save', params);
export const carts = (params = {}) => http.get('/mall/carts', {params});
export const deleteCarts = (params = {}) => http.post('/mall/carts/del', params);
export const selectCarts = (params = {}) => http.post('/mall/carts/selected', params);
